package com.example.service.Impl;

import com.example.common.LayuiResultJson;
import com.example.common.R;
import com.example.mapper.PrintManageMapper;
import com.example.pojo.PurchaseReceipt;
import com.example.pojo.Sale;
import com.example.service.PrintManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: ljc
 * Date: 2022/07/03 16:38
 * Description:
 * Version: V1.0
 */
@Service
public class PrintManageServiceImpl implements PrintManageService {
    @Autowired
    private PrintManageMapper printManageMapper;

    @Override
    public LayuiResultJson queryChuKuDan(Integer page, Integer limit) {
        LayuiResultJson r=new LayuiResultJson();
        Integer start = 0;
        Integer off =1;
        List<Sale> saleList=printManageMapper.queryChuKuDan(start,off);
        r.setCode(0);
        r.setMsg("success");
        r.setCount(1);
        r.setData(saleList);
        return r;
    }

    @Override
    public LayuiResultJson queryRuKuDan(Integer page, Integer limit,String medicine_name) {
        LayuiResultJson r=new LayuiResultJson();
        Integer start = 0;
        Integer off =1;
        List<PurchaseReceipt> purchaseReceiptList=printManageMapper.queryRuKuDan(start,off,medicine_name);
        r.setCode(0);
        r.setMsg("success");
        r.setCount(1);
        r.setData(purchaseReceiptList);
        return r;
    }


}
